package secondriver.springsubway.example.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class SimpleAroundAdvice implements MethodInterceptor {

	@Override
	public Object invoke(MethodInvocation invocation) throws Throwable {
		String className = invocation.getThis().getClass().getCanonicalName();
		String methodName = invocation.getMethod().getName();

		System.out.println("Method invoke before on " + className + "."
				+ methodName);

		Object result = invocation.proceed();

		System.out.println("方法调用结果：" + result);

		System.out.println("Method invoke after on " + className + "."
				+ methodName);
		
		return result;
	}

}
